package com.xinlong.dao;

import com.xinlong.entity.Vehicle;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface IVehicledao {

    //查
    @Select("select * from vehicle")
    List<Vehicle> selectVehicle();


    @Select("select * from vehicle where id=#{id}")
    List<Vehicle> selectVehicleById(String id);

    //增
    @Insert("insert vehicle values(null,#{name},#{number})")
    void sevaVehicle(Vehicle vehicle);

    //删
    @Delete("DELETE from vehicle where id=#{id}")
    void delVehicle(Integer id);

    //改
    @Update("update vehicle set name=#{name},number=#{number} where id=#{id}")
    void upVehicle(Vehicle vehicle);



}
